<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>2.7. odtone::mih::config Class Reference</title>
<link rel="stylesheet" href="../../../boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="../../../index.html" title="ODTONE 0.3">
<link rel="up" href="../index_mih.html" title="ODTONE MIH">
<link rel="prev" href="odtone_mih_confirm_class.html" title="2.5. odtone::mih::confirm Class Reference">
<link rel="next" href="odtone_mih_archive_class.html" title="2.7. odtone::mih::archive Class Reference">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr><td valign="top"><img alt="'ODTONE - Open Dot Twenty One'" width="100" height="100" src="../../.././images/logo.png"></td></tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="odtone_mih_confirm_class.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index_mih.html"><img src="../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="odtone_mih_archive_class.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
</div>
<div class="section" title="2.7. odtone::mih::config Class Reference">
<div class="titlepage"><div><div><h4 class="title">
<a name="odtone.library.index_mih.odtone_mih_config_class"></a><a class="link" href="odtone_mih_config_class.html" title="2.7. odtone::mih::config Class Reference">
        2.7. odtone::mih::config Class Reference</a>
</h4></div></div></div>
<a name="odtone.library.index_mih.odtone_mih_config_class.detailed_description"></a><h6>
<a name="id3067006"></a>
          <a class="link" href="odtone_mih_config_class.html#odtone.library.index_mih.odtone_mih_config_class.detailed_description">Detailed
          Description</a>
        </h6>
<p>
          <span class="bold"><strong>Configuration and command line options parser.</strong></span>
        </p>
<p>
          This class provides parsing for command line options and configuration
          files for a set of predefined options description. It's used for configuring
          the <a class="link" href="../index_sap/odtone_sap_class.html" title="2.1. odtone::sap::sap Class Reference">odtone::sap</a>
          IO services and the MIHF implementation.
        </p>
<a name="odtone.library.index_mih.odtone_mih_config_class.namespace"></a><h6>
<a name="id3067055"></a>
          <a class="link" href="odtone_mih_config_class.html#odtone.library.index_mih.odtone_mih_config_class.namespace">Namespace</a>
        </h6>
<p>
          
</p>
<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">odtone</span><span class="special">::</span><span class="identifier">mih</span>
</pre>
<p>
        </p>
<a name="odtone.library.index_mih.odtone_mih_config_class.public_member_functions"></a><h6>
<a name="id3067107"></a>
          <a class="link" href="odtone_mih_config_class.html#odtone.library.index_mih.odtone_mih_config_class.public_member_functions">Public
          Member Functions</a>
        </h6>
<p>
          
</p>
<pre class="programlisting"><span class="identifier">config</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">program_options</span><span class="special">::</span><span class="identifier">options_description</span> <span class="special">&amp;</span><span class="identifier">desc</span><span class="special">);</span>
<span class="special">~</span><span class="identifier">config</span><span class="special">();</span>

<span class="keyword">bool</span> <span class="identifier">help</span><span class="special">();</span>
<span class="keyword">void</span> <span class="identifier">parse</span><span class="special">(</span><span class="keyword">int</span> <span class="identifier">argc</span><span class="special">,</span> <span class="keyword">char</span><span class="special">*</span> <span class="identifier">argv</span><span class="special">[],</span> <span class="keyword">const</span> <span class="keyword">char</span><span class="special">*</span> <span class="identifier">conf_file_option</span><span class="special">);</span>

<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span>
<span class="identifier">T</span> <span class="identifier">get</span><span class="special">(</span><span class="keyword">const</span> <span class="keyword">char</span><span class="special">*</span> <span class="identifier">var</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
<span class="identifier">uint</span> <span class="identifier">count</span><span class="special">(</span><span class="keyword">const</span> <span class="keyword">char</span> <span class="special">*</span><span class="identifier">var</span><span class="special">);</span>
</pre>
<p>
        </p>
<a name="odtone.library.index_mih.odtone_mih_config_class.constructor__amp__destructor_documentation"></a><h6>
<a name="id3067412"></a>
          <a class="link" href="odtone_mih_config_class.html#odtone.library.index_mih.odtone_mih_config_class.constructor__amp__destructor_documentation">Constructor
          &amp; Destructor Documentation</a>
        </h6>
<p>
          
</p>
<pre class="programlisting"><span class="identifier">config</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">program_options</span><span class="special">::</span><span class="identifier">options_description</span> <span class="special">&amp;</span><span class="identifier">desc</span><span class="special">);</span>
</pre>
<p>
        </p>
<p>
          Construct a Configuration and Command Line Options Parser.
        </p>
<p>
          <span class="bold"><strong>Parameters:</strong></span>
        </p>
<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
<span class="bold"><strong>desc</strong></span> - a set of option descriptions.
          </li></ul></div>
<p>
          <span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span>
        </p>
<p>
          
</p>
<pre class="programlisting"><span class="special">~</span><span class="identifier">config</span><span class="special">();</span>
</pre>
<p>
        </p>
<p>
          Destructor for Configuration and Command Line Options Parser.
        </p>
<p>
          <span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span>
        </p>
<a name="odtone.library.index_mih.odtone_mih_config_class.member_function_documentation"></a><h6>
<a name="id3067787"></a>
          <a class="link" href="odtone_mih_config_class.html#odtone.library.index_mih.odtone_mih_config_class.member_function_documentation">Member
          Function Documentation</a>
        </h6>
<p>
          
</p>
<pre class="programlisting"><span class="keyword">bool</span> <span class="identifier">help</span><span class="special">();</span>
</pre>
<p>
        </p>
<p>
          Check if the <span class="emphasis"><em>help</em></span> option was specified
        </p>
<p>
          <span class="bold"><strong>Return</strong></span>
        </p>
<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
<span class="bold"><strong>true</strong></span> if the <span class="emphasis"><em>help</em></span>
            option is present or <span class="bold"><strong>false</strong></span> otherwise.
          </li></ul></div>
<p>
          <span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span>
        </p>
<p>
          
</p>
<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">parse</span><span class="special">(</span><span class="keyword">int</span> <span class="identifier">argc</span><span class="special">,</span>
           <span class="keyword">char</span><span class="special">*</span> <span class="identifier">argv</span><span class="special">[],</span>
           <span class="keyword">const</span> <span class="keyword">char</span><span class="special">*</span> <span class="identifier">conf_file_option</span><span class="special">);</span>
</pre>
<p>
        </p>
<p>
          Parse the command line arguments.
        </p>
<p>
          <span class="bold"><strong>Parameters:</strong></span>
        </p>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem">
<span class="bold"><strong>argc</strong></span> - number of arguments passed through
            the command line.
          </li>
<li class="listitem">
<span class="bold"><strong>argv</strong></span> - arguments passed through the
            command line.
          </li>
<li class="listitem">
<span class="bold"><strong>conf_file_option</strong></span> - name of configuration
            file.
          </li>
</ul></div>
<p>
          <span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span>
        </p>
<p>
          
</p>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span>
<span class="identifier">T</span> <span class="identifier">get</span><span class="special">(</span><span class="keyword">const</span> <span class="keyword">char</span><span class="special">*</span> <span class="identifier">var</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
</pre>
<p>
        </p>
<p>
          Get option variable value.
        </p>
<p>
          <span class="bold"><strong>Parameters:</strong></span>
        </p>
<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
<span class="bold"><strong>var</strong></span> - variable name.
          </li></ul></div>
<p>
          <span class="bold"><strong>Return</strong></span>
        </p>
<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
            Option variable value.
          </li></ul></div>
<p>
          <span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span><span class="underline">_</span>
        </p>
<p>
          
</p>
<pre class="programlisting"><span class="identifier">uint</span> <span class="identifier">count</span><span class="special">(</span><span class="keyword">const</span> <span class="keyword">char</span> <span class="special">*</span><span class="identifier">var</span><span class="special">);</span>
</pre>
<p>
        </p>
<p>
          Get number of option variable.
        </p>
<p>
          <span class="bold"><strong>Parameters:</strong></span>
        </p>
<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
<span class="bold"><strong>var</strong></span> - variable name.
          </li></ul></div>
<p>
          <span class="bold"><strong>Return</strong></span>
        </p>
<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
            Number of option variable.
          </li></ul></div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009 -2011 Universidade Aveiro<br>Copyright &#169; 2009 -2011 Instituto de Telecomunica&#231;&#245;es - P&#243;lo Aveiro<p>
        This software is distributed under a license. The full license agreement
        can be found in the LICENSE in this distribution. This software may not be
        copied, modified, sold or distributed other than expressed in the named license
        agreement. This software is distributed without any warranty.
      </p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="odtone_mih_confirm_class.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index_mih.html"><img src="../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="odtone_mih_archive_class.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
</div>
</body>
</html>
